package cn.tannn.lottery.controller;

import cn.tannn.lottery.entity.Award;
import cn.tannn.lottery.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据
 *
 * @author tn
 * @version 1
 * @date 2022-01-21 22:32
 */
@RestController
public class DataController {

    /**
     * 用户们
     * @return List
     */
    @GetMapping("users")
    public List<User> getUser(){
        List<User> users = new ArrayList<>();
        users.add(new User("13320385140","谭宁","1"));
        users.add(new User("13320385141","王五","2"));
        users.add(new User("13320385142","刘二","3"));
        users.add(new User("13320385143","张三","4"));
        users.add(new User("13320385144","many","5"));
        users.add(new User("13320385145","ni","6"));
        users.add(new User("13320385146","hi","7"));
        users.add(new User("13320385147","ja","8"));
        users.add(new User("13320385148","ta","9"));
        return users;
    }

    /**
     * 用户们
     * @return List
     */
    @GetMapping("award")
    public List<Award> getAward(){
        List<Award> awards = new ArrayList<>();
        awards.add(new Award("一等奖",1,"奖励手机"));
        awards.add(new Award("二等奖",2,"奖励电脑"));
        awards.add(new Award("三等奖",3,"奖励房子"));
        awards.add(new Award("四等奖",4,"奖励车子"));
        awards.add(new Award("五等奖",5,"奖励车厘子"));
        return awards;
    }

}
